#! /usr/bin/env python
#-*- coding: utf-8 -*-

# Balloon - An alternative to DropBox with file version control.
# It is based on Mercurial and supports Git.
# Copyright (C) 2011  Cédric Bonhomme - http://cedricbonhomme.org/
#
# For more information : http://bitbucket.org/cedricbonhomme/balloon/
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>

__author__ = "Cedric Bonhomme"
__version__ = "$Revision: 0.1 $"
__date__ = "$Date: 2011/10/31 $"
__revision__ = "$Date: 2011/10/31 $"
__copyright__ = "Copyright (c) Cedric Bonhomme"
__license__ = "GPLv3"

import time
import threading

from subprocess import *

def execute_command(cmd):
    """
    Execute a command and print the standard and error outputs.
    """
    try:
        p = Popen(cmd, shell=True, bufsize=1024, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
        (child_stdin, child_stdout, child_stderr) = (p.stdin, p.stdout, p.stderr)
        print child_stderr.read()
        print child_stdout.read()
    except Exception, e:
        print e


class GitSync(object):
    """
    The class is responsible of the synchronization of a Git repository.
    """ 
    def __init__(self):
        """
        """
        pass